package api.doctor;

import java.io.IOException;

import org.json.JSONException;
import org.json.JSONObject;


import common.Host;
import common.Request;

/**
 * 实现帮忙医医生端医生信息ModifyDoctorUser接口调用
 * @author lyn
 */
public class ModifyDoctorUser {
	/**
	 * 帮忙医APP修改个人资料ModifyDoctorUser接口
	 * @param caseName - 用例名称
	 * @param UserName - 用户名称
	 * @param OldPassword - 原密码
	 * @param Password - 新密码
	 * @param UserID - 用户ID
	 * @param HeadPicture - Base64编码的头像图片
	 * @return 接口返回数据
	 * @throws IOException
	 * @throws JSONException 
	 */
	public static String post( String UserName, String OldPassword, String Password, String UserID, String HeadPicture) throws IOException, JSONException
	{
		//拼接接口地址
		String url = Host.getAddress() + "/APIAccount/ModifyDoctorUser";	
						
		//给接口参数赋值
		JSONObject postParmsTemp = new JSONObject();
		JSONObject postParms = new JSONObject();
		postParmsTemp.put("UserName",UserName);
		postParmsTemp.put("OldPassword",OldPassword);
		postParmsTemp.put("Password",Password);
		postParmsTemp.put("UserID",UserID);
		postParmsTemp.put("HeadPicture",HeadPicture);
		postParms.put("param", postParmsTemp.toString());
					
		//调用接口并返回接口结果
		String result = null;
		result = Request.post(url, postParms);
		return result;
	}
}
